package android.xml;

import java.util.ArrayList;
import java.util.List;

import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

/*
 * spravuvac so stavkite vo slucaj da se pojavi nekoj isklucok 
 * pri citanje na xml dokumentite
 */
public class ItemsHandler<T> extends DefaultHandler {
	List<T> items;
	boolean done = false;

	public boolean isDone() {
		return done;
	}

	transient String currentElement;
	transient T currentItem;
	transient StringBuffer sb;

	@Override
	public void startDocument() throws SAXException {
		super.startDocument();
		items = new ArrayList<T>();
	}

	@Override
	public void endDocument() throws SAXException {
		super.endDocument();
		done = true;
	}

	public List<T> getItems() {
		return items;
	}
}
